#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main() 
{
    char word[21] = { 0 };
    char str[100][21] = { 0 };
    int i = 0;
    int j = 0;
    char ch = 0;
    while ((ch = getchar()) != '\n') 
    {
        if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) 
        {
            str[i][j++] = ch;
        }
        else 
        {
            str[i++][j] = 0;
            j = 0;
        }
    }
    for (; i >= 0; i--) 
    {
        printf("%s ", str[i]);
    }
    return 0;
}